package chapter02;

public class Test11_Rectangle {
    public static void main(String[] args) {
        Rectangle r = new Rectangle(20,20);
        int area = r.getArea();
        System.out.println("长方形的面积是"+area);
    }
}
class Rectangle{
    private int length;
    private int width;
    public Rectangle(int length,int width){
        this.length = length;
        this.width = width;
    }
    public int getArea(){
        return width*length;
    }
}